home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue.arc
/
TVWREAD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-09
|
1KB
|
40 lines
/*================================================*/
/* TVWREAD.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use as */
/* long as this copyright notice is kept intact */
/* and any changes are indicated in the comment */
/* blocks for the functions */
/*================================================*/
#include <stdio.h>
#include "tvapi.h"
/*================================================*/
/* TVwin_read read rest of current line from win */
/* Ralf Brown 4/3/88 */
/*================================================*/
int pascal TVwin_read(OBJECT win,void *buffer,int maxsize)
{
PARMLIST2 p ;
register int count ;
if (buffer == NULL)
return 0 ;
p.num_args = 0 ;
TVsendmsg(READ_MSG, win?TOS:ME, win, (PARMLIST *)&p) ;
count = (int) p.arg[1] ;
maxsize-- ; /* reserve space for null to terminate string */
if (count > maxsize)
count = maxsize ;
while (count--)
*((char *)buffer)++ = *((char far *)p.arg[0])++ ;
*((char *)buffer) = '\0' ;
return (int) p.arg[1] ;
}
/* End of TVWREAD.C */